Text File | 1999-04-27 | 778 b | 6 lines | [ttro/ttxt]
SpriteSurface Scrolling
By Geoff Perlman
The Scroll method of the SpriteSurface controls allows you to dynamically draw the background that the sprites move across. This allows for a virtual SpriteSurface that can essentially be infinite in size. This background is made up of 64 by 64 pixel squares. When the SpriteSurface Scroll method is called, the SpriteSurface's PaintTile event is called and passed a graphics object (to draw one of the 64 x 64 pixel squares into) and the x and y coordinates of the square to be drawn. When the SpriteSurface Run method is executed, the first square drawn is 0,0 and is in the upper-left corner of the screen.
Run the example and use the arrow keys to scroll the SpriteSurface. You will see the coordinates system change as you scroll.